import {request} from '@/apis';
import {addPrefix} from '@/utils/helper';
// @ts-ignore
const prefixUrl = '/ep-query';

const Api = {
  /** ESG事件列表 */
  GET_EVENT_LIST: '/getEsgEvent',
  /** ESG事件类型 */
  GET_EVENT_TYPE: '/screen/esgEventClassification',
  /** ESG风险等级 */
  GET_RISK_LEVEL: '/screen/esgEventRiskLevel',
  /** ESG行业筛选数据获取 */
  GET_ESG_INDUSTRY: '/screen/esgIndustryCategory',
  /** esg环境指标 */
  GET_ENVIRONMENT_INDICATOR: '/screen/esgEnvironmentalIndicator',
  /** esg行业指标 */
  GET_INDUSTRY_INDICATOR: '/screen/esgIndustryIndicator',
  /** esg环境年份筛选 */
  GET_ESG_YEAR: '/getTagYear',
  /** esg数据获取 */
  GET_ESG: '/getEsg',
  /** esg市场获取 */
  GET_MARKET_CODE: '/screen/marketCode',
  /** esg指数成分股获取 */
  GET_INDEX_CODE: '/screen/indexCode',
  /** esg币种获取 */
  GET_CURRENCY_CODE: '/screen/currencyCode',
  /** 社会治理指标获取 */
  GET_SG_INDICATOR: '/screen/sgPerformanceIndicator',
  /** 社会治理年份筛选 */
  GET_SG_YEAR: '/getSgTagYear',
  /** 社会治理数据获取 */
  GET_SG: '/getSgList',
};

addPrefix(Api, prefixUrl);

// @ts-ignore
export * from './types';


/** ESG环境指标获取 */
export const getEsgIndicators = (params) => request.get({
  url: Api.GET_ENVIRONMENT_INDICATOR,
  params
});
/** ESG行业指标获取 */
export const getEsgIndustryIndicators = (params) => request.get({
  url: Api.GET_INDUSTRY_INDICATOR,
  params
});
/** ESG行业指标获取 */
export const getSgIndicators = (params) => request.get({
  url: Api.GET_SG_INDICATOR,
  params
});
/** ESG年份获取 */
export const getEsgYear = (params) => request.get({
  url: Api.GET_ESG_YEAR,
  params
});

/** ESG列表数据获取 */
export const getEsg = (params) => request.post({url: Api.GET_ESG, params});
/** ESG市场筛选数据获取 */
export const getMarketCode = (params) => request.get({url: Api.GET_MARKET_CODE, params});
/** ESG指数成分股获取 */
export const getIndexCode = (params) => request.get({url: Api.GET_INDEX_CODE, params});
/** ESG币种获取 */
export const getCurrencyCode = (params) => request.get({url: Api.GET_CURRENCY_CODE, params});

/** ESG事件列表 */
export const getEsgList = (params) => request.get({url: Api.GET_EVENT_LIST, params});

/** ESG事件类型 */
export const getEventType = () => request.get({url: Api.GET_EVENT_TYPE}, {ignoreCancelToken: false});

/** ESG风险等级 */
export const getRiskLevel = () => request.get({url: Api.GET_RISK_LEVEL});

/** ESG行业筛选数据 */
export const getEsgIndustry = (params) => request.get({url: Api.GET_ESG_INDUSTRY, params});
/** 社会治理年份获取 */
export const getSgYear = (params) => request.get({
  url: Api.GET_SG_YEAR,
  params
});
/** 社会治理列表数据获取 */
export const getSg = (params) => request.get({url: Api.GET_SG, params});
